package com.example.demo02.controller;

import com.example.demo02.common.ResponseEntity;
import com.example.demo02.form.TcSpecialCarForm;
import com.example.demo02.service.TcSpecialCarService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value = "/specialcar")
public class SpecialCarController {
    @Resource
    TcSpecialCarService specialCarService;


    @RequestMapping(value = "/importBlackCar", method = RequestMethod.POST)
    public ResponseEntity<Object> importBlackCar(@RequestParam(value="file") MultipartFile file, HttpServletRequest httpRequest) {
        specialCarService.importBlackCar(file);
        return ResponseEntity.success();
    }



    @RequestMapping(value = "/blackCarExport", method = RequestMethod.POST)
    public void blackCarExport(@RequestBody TcSpecialCarForm tcSpecialCarForm, HttpServletRequest request, HttpServletResponse response) {
        specialCarService.blackCarExport(tcSpecialCarForm,request,response);
    }


}
